home *** CD-ROM | disk | FTP | other *** search
- on snapTo whichSprite, x, y
- set the visible of sprite 20 to 0
- set startH to the locH of sprite whichSprite
- set startV to the locV of sprite whichSprite
- set hDist to x - startH
- set vDist to y - startV
- if hDist > vDist then
- repeat with i = 1 to hDist
- set the locH of sprite whichSprite to startH + i
- set the locV of sprite whichSprite to startV + (i * float(vDist) / hDist)
- updateStage()
- end repeat
- else
- repeat with i = 1 to vDist
- set the locV of sprite whichSprite to startV + i
- set the locH of sprite whichSprite to startH + (i * float(hDist) / vDist)
- updateStage()
- end repeat
- end if
- set the locH of sprite whichSprite to x
- set the locV of sprite whichSprite to y
- set the visible of sprite 20 to 1
- puppetSound("poper")
- updateStage()
- end
-